<?php

namespace App\Datas;

use Illuminate\Support\Facades\DB;

class UserStyle extends Base
{

    public $tableName = "user_style";

    private static $instance = null;

    private function __construct()
    {
    }

    public static function getInstance() {
        if (empty(self::$instance) && !(self::$instance instanceof UserStyle)) {
            self::$instance = new self();
        }
        return self::$instance;
    }

    public function getCountByUserId($userId) {
        $count = DB::table($this->tableName)
            ->where(["user_id" => $userId])
            ->count();
        return $count;
    }
}